﻿using PlatformUW.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PlatformUW.EntityFramework
{
    public static class DataSeed
    {
        private static readonly Guid[] _guids =
        {
            Guid.NewGuid(),
            Guid.NewGuid()
        };


        public static Player[] Players { get; } =
        {
            new Player
            {
                Id = _guids[0],
                Account = "ZhangSan",
                AccountType = "Free",
                DateCreated = DateTime.Now,
            },
            new Player
            {
                Id = _guids[1],
                Account = "LiShi",
                AccountType = "Free",
                DateCreated = DateTime.Now,
            }
        };

        public static Characters[] Characters { get; } =
        {
            new Characters
            {
                Id = Guid.NewGuid(),
                NickName = "Code Man",
                Classes = "Mage",
                Level = 99,
                PlayerId = _guids[0],
                DateCreated = DateTime.Now,
            },
            new Characters
            {
                Id = Guid.NewGuid(),
                NickName = "Iron Man",
                Classes = "Warrior",
                Level = 90,
                PlayerId = _guids[0],
                DateCreated = DateTime.Now,
            },
            new Characters
            {
                Id = Guid.NewGuid(),
                NickName = "Spider Man",
                Classes = "Druid",
                Level = 80,
                PlayerId = _guids[0],
                DateCreated = DateTime.Now,
            },
            new Characters
            {
                Id = Guid.NewGuid(),
                NickName = "Batman",
                Classes = "Death Knight",
                Level = 90,
                PlayerId = _guids[1],
                DateCreated = DateTime.Now,
            },
            new Characters
            {
                Id = Guid.NewGuid(),
                NickName = "Superman",
                Classes = "Palain",
                Level = 99,
                PlayerId = _guids[1],
                DateCreated = DateTime.Now,
            },
        };

        public static SensorTable[] Sensors { get; } =
        {
            new SensorTable
            {
                Id = Guid.NewGuid(),
                Name = "Temperature",
                Description = "Temperature Sensor",
                Station = 1,
                RO_Address = 1,
                RO_Length = 10,
                RW_Address = 100,
                RW_Length = 10,
                Enabled = true,
                PortCategory = PortCategory.TCP,
                Ip = "192.168.1.100",
                Port = 5000,
                Protocol = ProtocolEnum.Modbus,
                DateCreated = DateTime.Now,
            },
            new SensorTable
            {
                Id = Guid.NewGuid(),
                Name = "Humidity",
                Description = "Humidity Sensor",
                Station = 2,
                RO_Address = 1,
                RO_Length = 10,
                RW_Address = 100,
                RW_Length = 10,
                Enabled = true,
                PortCategory = PortCategory.TCP,
                Ip = "192.168.1.100",
                Port = 5000,
                Protocol = ProtocolEnum.Modbus,
                DateCreated = DateTime.Now,
            },
            new SensorTable
            {
                Id = Guid.NewGuid(),
                Name = "Alitute",
                Description = "Alitute Sensor",
                Station = 1,
                RO_Address = 1,
                RO_Length = 10,
                RW_Address = 100,
                RW_Length = 10,
                Enabled = true,
                PortCategory = PortCategory.TCP,
                Ip = "192.168.1.100",
                Port = 5001,
                Protocol = ProtocolEnum.Modbus,
                DateCreated = DateTime.Now,
        },
            new SensorTable
            {
                Id = Guid.NewGuid(),
                Name = "Depth",
                Description = "Depth Sensor",
                Station = 1,
                RO_Address = 1,
                RO_Length = 10,
                RW_Address = 0,
                RW_Length = 0,
                Enabled = true,
                PortCategory = PortCategory.TCP,
                Ip = "192.168.1.101",
                Port = 5001,
                Protocol = ProtocolEnum.Depth,
                DateCreated = DateTime.Now,
           },
        };
    }
}
